<?php

namespace Home\Controller;
use Think\Controller;

class CompanytypeController extends Controller
{
	public function index()
	{
		$companyTypeModel = M('company_type');
		$companyTypeArray = $companyTypeModel
					->select();
		$this->assign('companyTypeArray',$companyTypeArray);
		$this->display();
	}

	public function add()
	{
		if(IS_POST)
		{
			$companyTypeModel = M('company_type');

			$companyTypeArray = $companyTypeModel->create();

			$id = $companyTypeModel->add($companyTypeArray);
			
            $this->redirect('index');
		}else
		{
			$this->display();
		}
	}
}